{template common/contentheader}
<div class="setcontent">
	<div class="settitle">
		<h3>{lang admin_content_censor:admin}</h3>{template content/contentcensor-submenu}
	</div>
	<div class="alert alert-info mt10">
		<span class="label label-info">{lang info:admin}</span>
		{lang admin_content_censor_tip:admin}
	</div>
	<div class="setform">
		<table class="table table-striped">
        <thead>
          <tr>
            <th width="80">ID</th>
            <th width="200">{lang censor_word:admin}</th>
            <th width="200">{lang censor_behiver:admin}</th>
            <th width="200">{lang censor_type:admin}</th>
            <th width="200">{lang censor_operate:admin}</th>
            <th width="200">{lang operation:admin}</th>
          </tr> 
        </thead>
        <tbody>
        {loop $censors $key $sm}
			<tr>
			<td>$sm['censor_id']</td>
			<td>$sm['find']</td>
			<td>{if strpos($sm['replacement'], 'BANNED')!=false}{lang censor_banned:admin}{elseif strpos($sm['replacement'], 'MOD')!=false}{lang censor_mod:admin}{else}{lang censor_replace:admin} {$sm['replacement']}{/if}</td>
			<td>$sm['typename']</td>
			<td>$sm['admin']</td>
			<td><a href="{url admin/contentcensor?act=delete&censorid=$sm['censor_id']}">{lang delete:admin}</a> 
			<a href="{url admin/contentcensor?act=edit&censorid=$sm['censor_id']}">{lang edit:admin}</a></td>
          	</tr>
		{/loop}
          
        </tbody>
		</table>
		<div class="text_c">$pages</div>
	</div>
	<div class="settitle">
		<h3>{lang censor_add:admin}</h3>
	</div>
	<div class="setform">
		<form class="pzform" method="post" action="{url admin/contentcensor?act=add}" id="addform">
			
			<div class="formgroup">
				<label class="formlabel">{lang censor_word:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="find" id="find"/>
				</div>
				<span class="formhelp">{lang censor_word:admin}</span>
			</div>
			
			<div class="formgroup">
				<label class="formlabel">{lang censor_behiver:admin}:</label>
				<div class="formcontrol">
					<select onchange="if($('#replacement').val()=='{REPLACE}'){$('#replacementtxt').css('display','block');}else{$('#replacementtxt').css('display','none');}" name="replacement" id="replacement">
					<option value="{BANNED}">{lang censor_banned:admin}</option>
					<option value="{MOD}">{lang censor_mod:admin}</option>
					<option value="{REPLACE}">{lang censor_replace:admin}</option>
					</select>
					<input type="text" name="replacementtxt" id="replacementtxt" style="display: none;"/>
				</div>
				<span class="formhelp">{lang censor_behiver:admin}</span>
			</div>
			
			<div class="formgroup">
				<label class="formlabel">{lang censor_type:admin}:</label>
				<div class="formcontrol">
					<select name="type" id="type">
					{loop $censortypes $type}
					<option value="$type['id']">$type['typename']</option>
					{/loop}
					</select>
					
				</div>
				<span class="formhelp">{lang censor_type:admin}</span>
			</div>
			
			<div class="formbuttons">
				<button type="submit" class="btn btn-primary">{lang add:admin}</button>
			</div>
		</form>
	</div>
</div>
{template common/contentfooter}